#define _CRT_SECURE_NO_WARNINGS 1

/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* sockCollocation(int* sockets, int socketsSize, int* returnSize) {
    int s1 = 0;
    int s2 = 0;
    for (int i = 0; i < socketsSize; i++)
    {
        if ((sockets[i] >> 1) == 1)
        {
            s1 ^= sockets[i];
        }
        else
        {
            s2 ^= sockets[i];
        }
    }
    int* result = (int*)malloc(sizeof(int) * 2);
    result[0] = s1;
    result[1] = s2;
    *returnSize = 2;
    return result;
}